{template 'common/header'}
<div class="main">
	<form class="form-horizontal form" id="form2" action="" method="post">
		<div class="panel panel-default">
			<div class="panel-heading">
				模块参数配置
			</div>
			<div class="panel-body">
                            
                            <div class="form-group">
                                    <label class="col-xs-12 col-sm-2 control-label">默认红包数量</label>
                                    <div class="col-sm-6">
                                            <input type="text" class="form-control input-medium" name="config[numbers]" value="{$settings['numbers']}" />
                                    </div>
                            </div>
                            <div class="form-group">
                                <label class="col-xs-12 col-sm-3 col-md-2 control-label">默认红包类型</label>
                                <div class="col-sm-8">
                                    <label class="radio-inline">
                                        <input type="radio" value="1" name="config[type]" {if $settings['type']==1}checked{/if}> 积分
                                    </label>
                                    <label class="radio-inline">
                                        <input type="radio" value="2" name="config[type]" {if $settings['type']==2}checked{/if}> 余额
                                    </label>
                                    <label class="radio-inline">
                                        <input type="radio" value="3" name="config[type]" {if $settings['type']==3}checked{/if}> 微信零钱
                                    </label>
                                    <span class="help-block">
                                        <p><strong class="text-danger">提示：</strong>微信零钱需要认证服务号才能用</p>
                                    </span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-xs-12 col-sm-3 col-md-2 control-label">红包金额</label>
                                <div class="col-sm-8">
                                    <div class="clearfix">
                                        <div class="col-sm-5" style="padding-left: 0;">
                                            <div class="input-group">
                                                <span class="input-group-addon">最小额度</span>
                                                <input class="form-control" type="number" value="{$settings['min_money']}" name="config[min_money]">
                                                <span class="input-group-addon">分</span>
                                            </div>
                                        </div>
                                        <div class="col-sm-5">
                                            <div class="input-group">
                                                <span class="input-group-addon">最大额度</span>
                                                <input class="form-control" type="number" value="{$settings['max_money']}" name="config[max_money]">
                                                <span class="input-group-addon">分</span>
                                            </div>
                                        </div>
                                    </div>
                                    <span class="help-block">
                                        <p><strong class="text-danger">提示：</strong>随机发红包的最大最小金额(分为单位)</p>
                                    </span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-xs-12 col-sm-2 control-label">引导关注素材</label>
                                <div class="col-sm-9 col-xs-12">
                                    <input type="text" class="form-control input-medium" name="config[subscribeurl]" value="{$settings['subscribeurl']}" />
                                    
                                    <span class="help-block">
                                        <p><strong class="text-danger">提示：</strong>强烈建议设置一条引导关注的素材链接。例:
                                            <a href="javascript:;" data-toggle="modal" data-target="#subscribeurl">点击查看</a></p>
                                    </span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-xs-12 col-sm-3 col-md-2 control-label">商户号</label>
                                <div class="col-sm-9 col-xs-12">
                                    <input type="text" name="config[mchid]" value="{$settings['mchid']}" class="form-control">
                                    <span class="help-block">您的微信支付商户号, 开通微信支付才能获得商户号</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-xs-12 col-sm-3 col-md-2 control-label">商户支付密钥</label>
                                <div class="col-sm-9 col-xs-12">
                                    <input type="text" name="config[password]" value="{$settings['password']}" class="form-control">
                                    <span class="help-block">您的微信支付商户所使用的支付密钥, 开通微信支付才能获得商户号</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-xs-12 col-sm-3 col-md-2 control-label">商户支付证书{if $is_apiclient_cert}<span style='color:red'>(已上传)</span>{/if}</label>
                                <div class="col-sm-9 col-xs-12">
                                    <textarea class="form-control" name="config[cert]" rows="8" placeholder="为保证安全性, 不显示证书内容. 若要修改, 请直接输入"></textarea>
                                    <span class="help-block">从商户平台上下载支付证书, 解压并取得其中的 <mark>apiclient_cert.pem</mark> 用记事本打开并复制文件内容, 填至此处</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-xs-12 col-sm-3 col-md-2 control-label">支付证书私钥{if $is_apiclient_key}<span style='color:red'>(已上传)</span>{/if}</label>
                                <div class="col-sm-9 col-xs-12">
                                    <textarea class="form-control" name="config[key]" rows="8" placeholder="为保证安全性, 不显示证书内容. 若要修改, 请直接输入"></textarea>
                                    <span class="help-block">从商户平台上下载支付证书, 解压并取得其中的 <mark>apiclient_key.pem</mark> 用记事本打开并复制文件内容, 填至此处</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-xs-12 col-sm-3 col-md-2 control-label">支付根证书{if $is_rootca}<span style='color:red'>(已上传)</span>{/if}</label>
                                <div class="col-sm-9 col-xs-12">
                                    <textarea class="form-control" name="config[ca]" rows="8" placeholder="为保证安全性, 不显示证书内容. 若要修改, 请直接输入"></textarea>
                                    <span class="help-block">从商户平台上下载支付证书, 解压并取得其中的 <mark>rootca.pem</mark> 用记事本打开并复制文件内容, 填至此处</span>
                                </div>
                            </div>
                            <div class="form-group">
                                    <label class="col-xs-12 col-sm-2 control-label">二维码LOGO</label>
                                    <div class="col-sm-6">
                                        {php echo tpl_form_field_image('config[ewmlogo]', $settings['ewmlogo']);}
                                    </div>
                            </div>
			</div>
		</div>
		<div class="form-group col-sm-12">
			<input name="token" type="hidden" value="{$_W['token']}" />
			<input type="submit" class="btn btn-primary col-lg-1" name="submit" value="提交" />
		</div>
	</form>
</div>
<!-- 引导素材示例模态框 -->
<div class="modal fade" id="subscribeurl" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
                <div class="modal-content" style="width:740px;">
                        <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                                <h4 class="modal-title" id="myModalLabel">引导关注示例</h4>
                        </div>
                        <div class="modal-body">
                                <h4>引导关注素材示例页面</h4>
                                <span class="help-block">{php echo date('Y-m-d', time());}&nbsp;&nbsp;
                                <a href="javascript:;">{$_W['account']['name']}</a></span>
                                <img src="{__IMG__}/1.gif" />
                                <span class="help-block">欢迎关注{$_W['account']['name']}</span>
                        </div>
                        <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        </div>
                </div>
        </div>
</div>
{template 'common/footer'}